import { Column, Entity } from "typeorm";

@Entity("platform", { schema: "charge" })
export class Platform {
  @Column("tinyint", { primary: true, name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "total_charge_order_count",
    comment: "总充电订单数",
    unsigned: true,
    default: () => "'0'",
  })
  totalChargeOrderCount: number;

  @Column("decimal", {
    name: "total_amount",
    comment: "总收入",
    precision: 12,
    scale: 2,
    default: () => "'0.00'",
  })
  totalAmount: string;

  @Column("decimal", {
    name: "total_profit",
    comment: "利润",
    precision: 12,
    scale: 2,
    default: () => "'0.00'",
  })
  totalProfit: string;

  @Column("float", {
    name: "total_kwh",
    unsigned: true,
    precision: 15,
    scale: 5,
    default: () => "'0.00000'",
  })
  totalKwh: number;

  @Column("int", {
    name: "total_time",
    comment: "总充电时长，秒",
    unsigned: true,
    default: () => "'0'",
  })
  totalTime: number;
}
